<?php

namespace app\common\validate\Product;

//引入底层的验证器类
use think\Validate;

/**
 * 订单商品验证器
 */
class Product extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'typeid' => 'require', //必填
        'name' => 'require', //必填
        'price' => 'require', //必填
        'stock' => 'require', //必填
        'thumbs' => 'require', //必填
        'content' => 'require', //必填
        'flag' => 'require', //必填
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'typeid.require'    => '商品分类ID未知',
        'name.require'    => '商品名称未知',
        'price.require'    => '请填写商品的单价',
        'stock.require'    => '请填写商品的库存',
        'thumbs.require'    => '商品的图片未知',
        'content.require'    => '商品内容未知',
        'flag.require'    => '商品标签未选',
    ];

    /**
     * 验证场景
     */
    protected $scene = [];
}
